/**
 * 
 */
package com.thor.palmmall.rest.common;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.common.ASourceBill;
import com.thor.palmmall.spi.basic.SSourceBill;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SSourceBillConverter implements Converter<ASourceBill, SSourceBill> {

  public static SSourceBillConverter getInstance() {
    if (instance == null)
      instance = new SSourceBillConverter();
    return instance;
  }

  private static SSourceBillConverter instance;

  private SSourceBillConverter() {
  }

  @Override
  public SSourceBill convert(ASourceBill source) {
    if (source == null) {
      return null;
    }
    SSourceBill target = new SSourceBill();
    target.setBillNumber(source.getBillNumber());
    target.setBillType(source.getBillType());
    target.setUuid(source.getUuid());
    return target;
  }

}
